import Vue from 'vue';
import App from './App.vue';
import ant from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import './assets/currency.css';
import router from './router';
import store from './store';
import './assets/style.css';
import * as _ from 'lodash';
import dateExt from '@/common/DateExt';
import axios from 'axios';
import infiniteScroll from 'vue-infinite-scroll';
import '@/directive/hasPermission';
import 'babel-polyfill';
import * as dateFmt from '@/common/moment-time';
Object.keys (dateFmt).forEach (key => Vue.filter (key, dateFmt[key]));
import {hasPermission} from '@/common/premission';
String.prototype.PadLeft = function (len, charStr) {
  var s = this + '';
  return new Array (len - s.length + 1).join (charStr, '') + s;
};
import {dateTimeFormatFun} from '@/common/timeMonth';
import {tabCacheListFun} from '@/common/dispatchEventStroage';
Vue.prototype.dateExt = dateExt;
Vue.prototype.$axios = axios;
Vue.prototype.hasPermission = hasPermission;
Vue.prototype.$baslurl = process.env.VUE_APP_BASEURL;
import './shared/mould.css'; //通用模板css
import print from '@/common/print';
// import Print from "print-js";
// Vue.use(Print);
// import VueAxios from 'vue-axios';
Vue.use (print);
Vue.config.productionTip = false;
Vue.use (ant);
Vue.use (infiniteScroll);
Vue.prototype.dateTimeFormatFun = dateTimeFormatFun;
/* 监听sessionStorage */
Vue.prototype.resetSetItem = tabCacheListFun;
// 注册一个全局自定义指令 `v-focus`
Vue.directive ('focus', {
  // 当被绑定的元素插入到 DOM 中时……
  inserted: function (el) {
    // 聚焦元素
    setTimeout (() => {
      el.focus ();
    }, 100);
  },
});
new Vue ({
  router,
  store,
  render: h => h (App),
}).$mount ('#app');
